package com.ruoyi.wechat.utils;

/**
 * <p>
 * 分页助手
 * </p>
 *
 * @author YinHeng
 * @since 2024/4/10
 */
public class PageHelper {

    private static ThreadLocal<Integer> pageNumLocal = new ThreadLocal<>();
    private static ThreadLocal<Integer> pageSizeLocal = new ThreadLocal<>();

    public static Integer getPageNum() {
        return pageNumLocal.get() == null ? 1 : pageNumLocal.get();
    }

    public static Integer getPageSize() {
        return pageSizeLocal.get() == null ? 10 : pageSizeLocal.get();
    }

    public static void setPageNum(Integer pageNum) {
        pageNumLocal.set(pageNum);
    }

    public static void setPageSize(Integer pageSize) {
        pageSizeLocal.set(pageSize);
    }


}
